    package db;

import java.sql.Connection;
import java.sql.DriverManager;
public class DBConnection {

	private static  String driverName = "com.mysql.jdbc.Driver"; 
	private static   String dbURL = "jdbc:mysql://127.0.0.1:3306/toothpaste?useUnicode=true&characterEncoding=UTF-8";
	private static   String userName = "root";
	private static   String userPwd = "root";
	public static Connection conn = null;
	private DBConnection(){
		
	}
	static{
		try {
			Class.forName(driverName);
			 conn = DriverManager.getConnection(dbURL, userName, userPwd);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public static Connection getConnection(){
		return conn;
	}
}


